@model OurWedding1.Models.TasksIndexViewModel
@using OurWedding1

@{
    ViewBag.Title = Resources.Tasks;
}
@Html.Partial("TasksHeading")


<div id="toolbar" class="ui-widget-header ui-corner-all">
    @Html.ActionLink(Resources.Create_New, "Create", null, new { @class = "createButtonLink" })
</div>

<div id="accordion">
    <h3>@Resources.Tasks_Done</h3>
    <div id="doneDiv">

        @Html.Partial("_Index", Model.Done)

    </div>
    <h3>@Resources.Tasks_ThisWeek</h3>
    <div>
        <div id="thisWeekDiv">
            @Html.Partial("_Index", Model.ThisWeek)
        </div>
    </div>

    <h3>@Resources.Tasks_ThisMonth</h3>
    <div>
        <div id="thisMonthDiv">
            @Html.Partial("_Index", Model.ThisMonth)
        </div>
    </div>

    <h3>@Resources.Tasks_NextMonth</h3>
    <div>
        <div id="nextMonthDiv">
            @Html.Partial("_Index", Model.NextMonth)
        </div>
    </div>

    <h3>@Resources.Tasks_Later</h3>
    <div>
        <div id="laterDiv">
            @Html.Partial("_Index", Model.Later)
        </div>
    </div>

</div>

@section Scripts{
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jqueryglob")
    @Scripts.Render("~/bundles/functions")

    <script type="text/javascript">
        $(function () {
            $(".createButtonLink").button({
                icons: {
                    primary: "ui-icon-plus"

                }//,
                //text: false
            });
            initTable("#doneDiv");
            initTable("#thisWeekDiv");
            initTable("#thisMonthDiv");
            initTable("#nextMonthDiv");
            initTable("#laterDiv");
            $("#accordion").accordion({
                heightStyle: "content",
                active: 1
            });
        });

        function initTable(div) {
            formatTable(div);
            editDeleteIconLinkInit(div);
            $(div + " .calendarIconLink").button({
                icons: {
                    primary: "ui-icon-calendar"
                },
                text: false
            });
        }

    </script>


}


